if (resultCode == RESULT_OK) {
	if (readBitmap(imageUri) != null && photo != null)
		photo.setImageBitmap(readBitmap(imageUri));

/*
...
skipping some code
...
*/

// Create a thumbnail of picture just taken at /sdcard/isle/
File imgfile = new File(Environment.getExternalStorageDirectory() + "/isle/" + editedItem.id + ".jpg");
FileOutputStream out = new FileOutputStream(imgfile);
Bitmap.createScaledBitmap(readBitmap(imageUri), THUMBNAIL_SIZE, THUMBNAIL_SIZE, false).compress(Bitmap.CompressFormat.JPEG, 90, out);

// Delete the photo just taken from sdcard
String filepath = convertImageUriToFile(imageUri).toString().replace("/mnt", "").replaceAll(File.pathSeparator, "");
boolean fileExists = new File(filepath).delete();
Log.i(TAG, "DELETE " + filepath + ": " + (fileExists ? "sucess" : "failed"));

// Check for new images in the camera folder and delete them
File[] imageFilesAfterCam = new File(CAMERA_FOLDER).listFiles();
for (File check : imageFilesAfterCam) {
	boolean delete = true;
		for (File against : imageFiles) {
			if (check.getName().equals(against.getName())) {
				delete = false;
			}
		}
	if (delete) {
		check.delete();
	}
}

// Set the imageUri to be saved into the database
imageUri = Uri.parse("file://" + Environment.getExternalStorageDirectory() + "/isle/" + editedItem.id + ".jpg");
